package code;

public class QuestionNum_05_3 {
    public static void main(String[] args) {
        isPrimeNum();
    }

    public static void isPrimeNum(){
        int sum = 0;
        int countFlag = 0;
        int flag = 0;
        for (int i=1;i<=100;i++){
            for (int j=1;j<=i;j++){
                if (i % j == 0){
                    countFlag++;
                }
            }
            if (countFlag != 2){
                System.out.print(i+" ");
                sum++;
                flag++;
                if (flag == 5){
                    flag = 0;
                    System.out.println(" ");
                }
            }
            countFlag = 0;
        }
        System.out.println("一共有"+sum+"个素数");
    }
}
